﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Data.Extensions;
using ModernChannel.Configuration;
using ModernChannel.Model.Model;

namespace ModernChannel.Data.DBConfig
{
    public class SerialNumberCdcHistConfiguration : DBConfig<SerialNumberCdcHist>
    {
        public SerialNumberCdcHistConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.Model, k.Suffix, k.SerialNo });
            Property(c => c.UniqueId).IsRequired();
            Property(c => c.Model).IsRequired();
            Property(c => c.Suffix).IsRequired();
            Property(c => c.OrderNo).HasMaxLength(12).IsRequired();
            Property(c => c.ShiptoCode).HasMaxLength(20).IsRequired();
            Property(c => c.SerialNo).HasMaxLength(50).IsRequired();
            Property(c => c.LoadplanNo).HasMaxLength(20).IsRequired();
            Property(c => c.InvOrg).HasMaxLength(3).IsRequired();
            Property(c => c.ModelSuffix).HasMaxLength(50).IsRequired();
        }
    }
}
